/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Model;
import java.util.Comparator;

/**
 *
 * @author oskar
 */
public class TimeComparator implements Comparator<Trip> {
    
    public int compare(Trip t1, Trip t2)
    {
        if(t1.getDuration()>t2.getDuration())
            return 1;
        else if(t1.getDuration()<t2.getDuration())
            return -1;
        return 0;
        
    }
}

